<?php

require 'vendor/autoload.php';

use Aws\DynamoDb\DynamoDbClient;
use Aws\Common\Enum\Region;
use Aws\DynamoDb\Enum\Type;
use Aws\DynamoDb\Enum\ComparisonOperator;

// Instantiate the client with your AWS access keys
$aws = Aws\Common\Aws::factory("/home/ubuntu/config.php");
$client = $aws->get("dynamodb");

$tableName = "image";
$request = array(
	"TableName" => $tableName,
	"KeyConditions" => array(
		"page_id" => array(
			"ComparisonOperator" => ComparisonOperator::EQ,
			"AttributeValueList" => array(
				array(Type::NUMBER => 1)
			)
		)
	)
);
$response = $client->query($request);
echo json_encode($response['Items']);
?>

